package com.beans;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author : niu niu
 * @version : 1.0.0
 * @date : 2023/4/4 14:00
 */
@Component
public class GetUsers {
    @Bean
    public User getUser(){
        User user = new User();
        user.setID("1");
        user.setName("牛牛");
        return user;
    }
    @Bean (name = "user1")
    public User getUser1(){
        User user = new User();
        user.setID("1");
        user.setName("单重命名");
        return user;
    }
    @Bean({"user2","user3"})
    public User getUser2(){
        User user = new User();
        user.setID("1");
        user.setName("两个重命名");
        return user;
    }
}
